<template>
    <WorksDetail :templateStatus="templateStatus" :playStatus="playStatus" @edit="edit"></WorksDetail>
</template>
<script>
import WorksDetail from '../components/WorksDetail.vue';
import { createWorks,editWorks } from '@/api/works.js';
export default {
    name: '',
    data() {
        return {
            templateStatus:'view',
            playStatus:true
        };
    },
    computed: {},
    onLoad() {
        this.$uniPromise.setTitle(this.vuex_templateData.name);
        wx.showShareMenu({
            menus: ['shareAppMessage', 'shareTimeline']
        });
    },
    onShow() {
        this.playStatus=true;
    },
    created() {},
    methods: {
           edit(){
               this.playStatus=false;
           }
    },
    watch: {},
    components: { WorksDetail },
    beforeDestroy() {
        this.playStatus = false;
    },
    onShareAppMessage(res) {
        let shareData =JSON.stringify({
            worksId: this.vuex_worksId,
            name: this.vuex_templateData.name,
        });
        let sharedInfo = JSON.stringify({
            avatar: this.vuex_avatarUrl,
            nickName: this.vuex_nickName,
            userSignature: this.vuex_userSignature
        });
        return {
            title: `${this.vuex_nickName}分享了相册"${this.vuex_templateData.name}"`,
            path: `/pages/empty/empty?shareData=${shareData}&sharedInfo=${sharedInfo}`,
            imageUrl: `${this.vuex_templateData.theme}`
        };
    }
};
</script>
<style lang="scss" scoped>
.wrap {
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 66;
    .music-wrap {
        position: fixed;
        right: 30rpx;
        top: 30rpx;
        width: 58rpx;
        height: 58rpx;
        z-index: 20;
    }
    .view-info-wrap {
        position: fixed;
        left: 0;
        bottom: 0;
        width: 750rpx;
        height: 160rpx;
        z-index: 20;
    }


}
</style>
